package com.mxpio.erp.common.equipment.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.jpa.policy.impl.UUIDPolicy;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * 设备BOM更换记录对象 MB_ERP_EQUIPMENT_EQP_BOM_RECORDS
 *
 * @author Cheng
 * @date 2023-07-01
 */
@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_EQUIPMENT_EQP_BOM_RECORDS")
@Schema(description="设备BOM更换记录")
public class EquipmentEqpBomRecords extends BaseEntity {

private static final long serialVersionUID=1L;

    @Id
    @Generator(policy = UUIDPolicy.class)
    @Column(name = "ID_")
    @Schema(description = "主键")
    private String id;

    @Column(name = "BASICS_CODE_")
    @Schema(description = "设备资产ID")
    @Dict(dicCode = "basicsCode", dicEntity = EquipmentEqpBasics.class, dicText = "eqpName")
    private String basicsCode;

    @Column(name = "REPLACE_DATE_")
    @Schema(description = "更换时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date replaceDate;

    @Column(name = "BOM_CODE_")
    @Schema(description = "BOM编码")
    private String bomCode;

    @Column(name = "BOM_NAME_")
    @Schema(description = "BOM名称")
    private String bomName;

    @Column(name = "SPEC_TYPE_")
    @Schema(description = "规格尺寸")
    private String specType;

    @Column(name = "REASON_")
    @Schema(description = "更换原因")
    @Dict(dicCode = "ERP_EQUIPMENT_BOM_CHANGE_REASON")
    private String reason;

    @Column(name = "BUSINESS_ID_")
    @Schema(description = "目标工单ID")
    private String businessId;

    @Column(name = "OPERATION_TYPE_")
    @Schema(description = "操作类型")
    @Dict(dicCode = "ERP_EQUIPMENT_BOM_OPERATE_TYPE")
    private String operationType;

    @Column(name = "NEW_BOM_CODE_")
    @Schema(description = "现BOM编码")
    private String newBomCode;

    @Column(name = "IS_DEL_")
    @Schema(description = "是否删除（0-正常；1-删除）")
    private Integer isDel;

    @Column(name = "BOM_ID_")
    @Schema(description = "BOMid")
    private String bomId;

    @Column(name = "BUSINESS_CODE_")
    @Schema(description = "工单编码")
    private String businessCode;


}
